package chenji.gunapi.untl.nbt;
import org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;

import net.minecraft.server.v1_9_R2.NBTTagCompound;
/**
 * 参照Code
 * @author ChenJi
 *
 */
public class NMSItemCopy extends NMSItem {
	net.minecraft.server.v1_9_R2.ItemStack nmsItem = null;
	NBTTagCompound tag;
	ItemStack item;
	@Override
	public NMSItem setItem(ItemStack i) {
		this.item = i;
		this.nmsItem = CraftItemStack.asNMSCopy(i);
		this.tag = this.nmsItem.getTag();
		if (tag == null) {
			tag = new NBTTagCompound();
		}
		return this;
	}
	@Override
	public ItemStack getItem() {
		return CraftItemStack.asBukkitCopy(nmsItem);
	}

	@Override
	public NMSItem setString(String path, String s) {
		this.tag.setString(path, s);
		return this;
	}

	@Override
	public NMSItem setShort(String path, short s) {
		this.tag.setShort(path, s);
		return this;
	}

	@Override
	public Object getNBTTagCompound() {
		return this.nmsItem.getTag();
	}

	@Override
	public Object getNMSItemStack() {
		return this.nmsItem;
	}

	@Override
	public NMSItem setInteger(String path, int s) {
		this.tag.setInt(path, s);
		return this;
	}

	@Override
	public NMSItem setLong(String path, long s) {
		this.tag.setLong(path, s);
		return this;
	}

	@Override
	public NMSItem setBoolean(String path, boolean s) {
		this.tag.setBoolean(path, s);
		return this;
	}

	@Override
	public NMSItem setDouble(String path, double s) {
		this.tag.setDouble(path, s);
		return this;
	}

	@Override
	public NMSItem setFloat(String path, float s) {
		this.tag.setFloat(path, s);
		return this;
	}

	@Override
	public NMSItem setByteArray(String path, byte[] s) {
		this.tag.setByteArray(path, s);
		return this;
	}

	@Override
	public NMSItem setIntegerArray(String path, int[] s) {
		this.tag.setIntArray(path, s);
		return this;
	}

	@Override
	public NMSItem setByte(String path, byte b) {
		this.tag.setByte(path, b);
		return this;
	}


	@Override
	public int getInteger(String path) {
		return this.tag.getInt(path);
	}

	@Override
	public long getLong(String path) {
		return this.tag.getLong(path);
	}

	@Override
	public boolean getBoolean(String path) {
		return this.tag.getBoolean(path);
	}

	@Override
	public double getDouble(String path) {
		return this.tag.getDouble(path);
	}

	@Override
	public float getFloat(String path) {
		return this.tag.getFloat(path);
	}

	@Override
	public byte[] getByteArray(String path) {
		return this.tag.getByteArray(path);
	}

	@Override
	public int[] getIntegerArray(String path) {
		return this.tag.getIntArray(path);
	}

	@Override
	public byte getByte(String path) {
		return this.tag.getByte(path);
	}

	@Override
	public String getString(String path) {
		return this.tag.getString(path);
	}

	@Override
	public short getShort(String path) {
		
		return this.tag.getShort(path);
	}
}
